import http from "@/utils/http";

export default {
    getlist: (): Promise<Vm.Cart[]> => http<null, Vm.Cart[]>({ url: 'cart/list', method: 'post' }),
    gettotal: (data: string): Promise<number> => http<string, number>({ url: 'cart/total', method: 'get', data }),
    decrease: (id: number): Promise<null> => http<number, null>({ url: 'cart/decrease/' + id, method: 'post' }),
    increase: (id: number): Promise<null> => http<number, null>({ url: 'cart/increase/' + id, method: 'post' }),
    remove: (data: { ids: Array<number> }): Promise<null> => http<{ ids: Array<number> }, null>({ url: 'cart/remove', method: 'post', data }),
    getConfirmList: (data: { ids: Array<number> }) => http<{ ids: Array<number> }, Vm.Cart[]>({ url: 'cart/list_ids', method: 'post', data }),
    add: (data: HttpPayload.Addshop) => http<HttpPayload.Addshop,null>({ url: 'cart/add', method: 'post', data })
}